// 路由表文件

// vue-router给我们提供的类型
import type { RouteRecordRaw } from 'vue-router'

// 1. 引入组件写法
// import HomePage from '@/views/home/index.vue'
// import AboutPage from '@/views/about/index.vue'
// import HomeListPage from '@/views/home.list/index.vue'
// const routes: RouteRecordRaw[] = [
//     {
//         path: '/',
//         component: HomePage,
//         children: [
//             {
//                 path: '',
//                 component: HomeListPage
//             }
//         ]
//     },
//     {
//         path: '/about',
//         component: AboutPage
//     }
// ]

// 2. 懒加载组件写法
const routes: RouteRecordRaw[] = [
    {
        path: '/',
        component: () => import('@/views/home/index.vue'),
        children: [
            {
                path: '',
                component: () => import('@/views/home.list/index.vue')
            }
        ]
    },
    {
        path: '/about',
        component: () => import('@/views/about/index.vue')
    }
]

export default routes
